class MainBg extends egret.DisplayObjectContainer{
	public constructor() {
		super();
		 this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
	}
	public onAddToStage(){


        //  new Bg(this, "global_bg_png");
        
		//加载背景界面

		let icon: egret.Bitmap = this.createBitmapByName("main_bg_png");
        this.addChild(icon);
        let stageW: number = this.stage.stageWidth;
        let stageH: number = this.stage.stageHeight;
        icon.width = stageW;
        icon.height = stageH;

	}

	private createBitmapByName(name: string): egret.Bitmap {
        let result = new egret.Bitmap();
        let texture: egret.Texture = RES.getRes(name);
        result.texture = texture;
        return result;

    }
}